﻿package net.wangit.view.unit.util;

import net.wangit.view.unit.UnitComponent;

public class UnitUtil {

	public UnitUtil() {
	}

	public static String getOperator(String unitId) {
		return (new StringBuilder(String.valueOf(unitId))).append(".")
				.toString();
	}

	public static String getUrl(UnitComponent uc) {
		return (new StringBuilder(String.valueOf(uc.getDomain()))).append("/")
				.append(uc.getId()).toString();
	}

	public static String getKey(UnitComponent uc) {
		return getKey(uc.getDomain(), uc.getId());
	}

	public static String getKey(String domain, String unitId) {
		return (new StringBuilder(String.valueOf(domain))).append(",").append(
				unitId).toString();
	}
}
